package com.zkingsoft.services.impl;

import com.zkingsoft.services.NeedService;
import com.zkingsoft.plugin.pojo.PaginationVO;
import com.zkingsoft.model.Need;
import com.zkingsoft.dao.NeedDao;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;

/**
 * 
 * @description 需求ServiceImpl
 * @author chenxianzi
 * @date 2016年12月22日
 */
@Service("needService")
public class  NeedServiceImpl implements    NeedService  {

	
	@Autowired
	private NeedDao needDao;
	
	
	@Override
	public int add(Need need){
		
		return needDao.insert(need);
		
	}
   	
    @Override
	public int modify(Need need){
	
		return needDao.update(need);
	
	}
	
	@Override
	public int remove(List<Long> list){
	
		return needDao.deleteByIds(list);
	
	}

	@Override
	public int removeById(Long id){
	
		return needDao.deleteById(id);
	
	}
	
	@Override
	public int removeByModel(Need need){
	
		return needDao.deleteByModel(need);
	
	}
	
	
	@Override
	public List<Need> findInPage(Need need,  PaginationVO pageVo){
	
		return needDao.selectInPage(need , pageVo);
	
	}
	
	@Override
	public List<Need> findByModel(Need need){
	
		return needDao.selectByModel(need);
	
	}
	
	@Override
	public int  findTotal(Need need){
	
		return needDao.selectTotalRecord(need);
	
	}
	
	@Override
	public Need  findById(Long id){
	
		return needDao.selectById(id);
	
	}

   	
	
	
}